package com.sky.controller;


import com.sky.result.Result;
import com.sky.service.SteelMatterService;
import lombok.val;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

/**
 * 物料
 */
@Controller()
@RequestMapping("/steelMatter")
public class SteelMatterController {

    @Resource
    private SteelMatterService steelMatterService;


    /**
     * 根据物料类型id查询物料信息
     * @return
     */
    @RequestMapping("/list/{id}")
    public Result list(@PathVariable("id") Integer id){
        System.out.println("物料类型id:"+id);
        final val list = steelMatterService.getSteelMatterListByTypeId(id);
        return Result.success(list);
    }
}
